package com.engineering.elink.common;

public enum HessianResultEnum {

	Success("请求成功", 0), 
	ParamError("参数错误", 101), 
	TypeIdNotExist("积分类别不存在", 101), 
	UserIdNotExist("用户不存在", 102), 
	CoinNotEnough("金币不足", 103),
	TypeIdError("积分类别错误", 104),
	GetCoinError("获取积分已经达到上限", 105);
	
	// 成员变量
	private String name;
	private int index;

	// 构造方法
	private HessianResultEnum(String name, int index) {
		this.name = name;
		this.index = index;
	}

	// 普通方法
	public static String getName(int index) {
		for (HessianResultEnum c : HessianResultEnum.values()) {
			if (c.getIndex() == index) {
				return c.name;
			}
		}
		return null;
	}

	// get set 方法
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}
	
	public String toString () {
		
		return "index=" + this.index + "&&name=" + this.name;
	}
}
